﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Fotobanka
{
    /// <summary>
    /// Trida reprezentujici tabulku User v databazi
    /// </summary>
    public class UserObject
    {
        private int id;
        private string email;
        private string first_name;
        private string last_name;
        private string phone;
        private DateTime last_login;
        private string password_hash;
        private byte lock_version;
        private DateTime created_on;
        private DateTime updated_on;
        private byte authorization;
        private byte gallery_admin;
        private string mobil_phone;
        private int icq;
        private string skype;
        private int role;

        public int Id
        {
            get {
                return id;
            }
            set {
                id = value;
            }
        }

        public string Email
        {
            get {
                return email;
            }
            set {
                email = value;
            }
        }

        public string FirstName
        {
            get {
                return first_name;
            }
            set {
                first_name = value;
            }
        }

        public string LastName
        {
            get {
                return last_name;
            }
            set {
                last_name = value;
            }
        }

        public string Phone {
            get {
                return phone;
            }
            set {
                phone = value;
            }
        }

        public DateTime LastLogin
        {
            get {
                return last_login;
            }
            set {
                last_login = value;
            }
        }

        public string PasswordHash
        {
            get {
                return password_hash;
            }
            set {
                password_hash = value;
            }
        }

        public byte Lock
        {
            get {
                return lock_version;
            }
            set {
                 lock_version = value;
            }
        }

        public DateTime CreatedOn
        {
            get {
                return created_on;
            }
            set {
                created_on = value;
            }
        }

        public DateTime UpdatedOn
        {
            get {
                return updated_on;
            }
            set {
                updated_on = value;
            }
        }

        public byte Authorization
        {
            get {
                return authorization;
            }
            set {
                authorization = value;
            }
        }

        public byte GalleryAdmin
        {
            get {
                return gallery_admin;
            }
            set {
                gallery_admin = value;
            }
        }

        public string MobilPhone
        {
            get {
                return mobil_phone;
            }
            set {
                mobil_phone = value;
            }
        }

        public int Icq
        {
            get {
                return icq;
            }
            set {
                icq = value;
            }
        }

        public string Skype
        {
            get {
                return skype;
            }
            set {
                skype = value;
            }
        }

        public int Role
        {
            get {
                return role;
            }
            set {
                role = value;
            }
        }

        public UserObject() 
        {

        }
        /// <summary>
        /// UserObject konstruktor tridy UserObject
        /// </summary>
        /// <param name="fname">prijmeni</param>
        /// <param name="lname">jmeno</param>
        /// <param name="phone">telefon</param>
        /// <param name="pass">heslo</param>
        /// <param name="gadmin">admin galerie</param>
        /// <param name="mobil">mobil</param>
        /// <param name="icq">icq</param>
        /// <param name="skype">skype</param>
        public UserObject(string fname,string lname, string phone, string pass, bool gadmin, string mobil, int icq, string skype) 
        {
            this.FirstName = fname;
            this.LastName = lname;
            this.Phone = phone;
            this.PasswordHash = Utils.GetMd5Hash(pass);
            this.GalleryAdmin = Convert.ToByte(gadmin);
            this.MobilPhone = mobil;
            this.Icq = icq;
            this.Skype = skype;
        }
   
    }
}
